<?php

class BaseController {
	public $view = null;
	public $render = null;
	public $redirect = null;
	public $tpl;
	protected $cache;
	protected $interceptor;
	
	public function __construct() {
		$this->tpl = new Template();
	}
	
	public function assert($arg) {
		return (!isset($arg) || $arg == "") ? false : true;	
	}
	
	public function render($viewUrl) {
		$this->render = $viewUrl;
		include VIEW_PATH.$this->render;
	}
	
	public function redirect($controller, $action, $params = null) {
		$this->redirect["controller"] = $controller;
		$this->redirect["action"] = $action;
		$this->redirect["params"] = $params;
	}
	
	public function getRedirect() {
		return $this->redirect;
	}
	
	public function display($template) {
		$this->tpl->display(TPL_PATH.$template, $this->view);
	}
	
	public function assign($key, $value) {
		$this->tpl->assgin($key, $value);
	}
	
	public function get($key, $value) {
		
	}
}

?>